<?php
/**
 * @copyright meila.com
 * @author shaopu@
 * @name 
 * @param 
 *         $xxx = 作用
 * @static 
 *         XXX = 作用
 * 
 * 
 */
$dir = dirname(dirname(__FILE__));
include($dir.'/__queue_global.php');


$oModGdAudit = new ml_model_admin_dbGoodsAudit();

$aRedisconf = ml_factory::load_standard_conf('redis');
$oBizHash2rds = new ml_biz_guang_hash2redis($aRedisconf['meila_guang'][0]);

$rs = $oModGdAudit->count_goods(ml_model_admin_dbGoodsAudit::AUDITSTATUS_PASS);
$total = $oModGdAudit->get_data();
$pagesize = 20;
$page = ceil($total/$pagesize);
for ($i=0; $i < $page; $i++) { 
    $rs = $oModGdAudit->list_goods(ml_model_admin_dbGoodsAudit::AUDITSTATUS_PASS , $page , $pagesize);
    $aData = $oModGdAudit->get_data();

    foreach ($aData as $key => $content) {
        $content ['hotrank'] = ml_tool_hotrank::getguanghotrank ( strtotime ( "+" . $i . " hours" ), $content ['score'] );

        $oBizHash2rds->addtoredis($content);
    }
}